Skip to content

Custom dtype - bf16/fp16 support - #1175

Open
asmigosw wants to merge 21 commits into
quic:mainfrom
asmigosw:custom_dtype_support
Open

Custom dtype - bf16/fp16 support#1175
asmigosw wants to merge 21 commits into
quic:mainfrom
asmigosw:custom_dtype_support

Conversation

@asmigosw

Copy link
Copy Markdown
Contributor

Custom dtype support added for models:

  1. Gemma4
  2. Qwen3VLMoe
  3. Qwen3_5
  4. Qwen3_5Moe

@asmigosw
asmigosw marked this pull request as draft July 11, 2026 17:36
Signed-off-by: Asmita Goswami <asmigosw@qti.qualcomm.com>
Signed-off-by: Asmita Goswami <asmigosw@qti.qualcomm.com>
Signed-off-by: Asmita Goswami <asmigosw@qti.qualcomm.com>
Signed-off-by: Asmita Goswami <asmigosw@qti.qualcomm.com>
Signed-off-by: Asmita Goswami <asmigosw@qti.qualcomm.com>
Signed-off-by: Asmita Goswami <asmigosw@qti.qualcomm.com>
Signed-off-by: Asmita Goswami <asmigosw@qti.qualcomm.com>
Signed-off-by: Asmita Goswami <asmigosw@qti.qualcomm.com>
Signed-off-by: Asmita Goswami <asmigosw@qti.qualcomm.com>
@asmigosw
asmigosw force-pushed the custom_dtype_support branch from 15f458c to 4fbfbdd Compare August 27, 2026 07:29
Signed-off-by: Asmita Goswami <asmigosw@qti.qualcomm.com>
@asmigosw
asmigosw marked this pull request as ready for review August 27, 2026 16:21
Signed-off-by: asmigosw <asmigosw@qti.qualcomm.com>
Signed-off-by: Asmita Goswami <asmigosw@qti.qualcomm.com>
Signed-off-by: Asmita Goswami <asmigosw@qti.qualcomm.com>
@asmigosw

asmigosw commented Sep 9, 2026

Copy link
Copy Markdown
Contributor Author

CI-ready

Comment thread QEfficient/base/modeling_qeff.py Outdated
Comment on lines +1290 to +1296
model_in_bfloat16 = hasattr(self, "config") and (self.config.torch_dtype == torch.bfloat16)
io_name_prefix = ("past_", "pixel_values", "conv_", "recurrent_")
pkv_in_bfloat16 = (custom_io is not None) and any(
any(bfloat16_io_name in key for bfloat16_io_name in io_name_prefix) and "bfloat16" in value
for key, value in custom_io.items()
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is this doing? its not used anywhere?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is being used at line 1303, it is required for custom_io is case bf16 is passed as dtype.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't this already happening on line 1193, why duplicate here? maybe do changes there itself?

@quic-rishinr

Copy link
Copy Markdown
Contributor

CI-Ready

Signed-off-by: Asmita Goswami <asmigosw@qti.qualcomm.com>
@asmigosw

Copy link
Copy Markdown
Contributor Author

CI-Ready

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants